﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LitJson;
public class ConditionTaskDataSerializor : ITaskDataSerializor
{
    public ITaskData DeSerializeData(string json)
    {
        JsonData data = JsonMapper.ToObject(json);
        ConditionTaskData task = new ConditionTaskData();
        task.LeftArgs = data["LeftArgs"].AsString;
        task.RightArgs = data["RightArgs"];
        task.Operator = (OperatorType)data["Operator"].AsInt;
        task.LeftComponentType = (ComponentType)data["LeftComponentType"].AsInt;
        task.RightComponentType = (ComponentType)data["RightComponentType"].AsInt;
        task.RightArgsType = (ConstType)data["RightArgsType"].AsInt;
        return task;
    }

    public string SerializeData(ITaskData nodeData)
    {
        throw new NotImplementedException();
    }
}